<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改style样式</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app" @click='changepic'
                  :style=[actived_color]
    >hello world
    </div>
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                actived_color:{
                    color:'black',
                },
            },
            methods:{
                changepic:function(){
                   this.actived_color.color =  this.actived_color.color==='black'?'red':'black';
                } 
            }
        })
        
    </script>
</body>
</html>